﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;

namespace paper.evisa99.com.Controllers.Class
{
    public class Kore
    {
        ///=======================================================================================
        public string CreateID(string Header)
        {
            string NewID = Header;
            DateTime CurrentTime = DateTime.Now;

            NewID += Encoding.ASCII.GetString(new byte[] { (byte)(65 + CurrentTime.Year - 2010) });
            NewID += Encoding.ASCII.GetString(new byte[] { (byte)(65 + CurrentTime.Month) });
            if (CurrentTime.Day < 10)
            {
                NewID += CurrentTime.Day.ToString();
            } else
            {
                NewID += Encoding.ASCII.GetString(new byte[] { (byte)(65 + CurrentTime.Day - 10) });
            }
            NewID += Encoding.ASCII.GetString(new byte[] { (byte)(65 + CurrentTime.Hour) });
            NewID += Encoding.ASCII.GetString(new byte[] { (byte)(65 + Convert.ToInt16(CurrentTime.Minute / 3)) });
            NewID += CurrentTime.ToString("ss");
            NewID += CurrentTime.Millisecond.ToString() + "000";
            NewID = NewID.Substring(0, 12);
            return NewID;
        }
        //----------------------------------------------------------------------------------------------------------------------------------------------

    }
}